﻿
namespace GlobalOfficeTools.MVC3.DomainServices.Clients
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using GlobalOfficeTools.MVC3.Models;
    using System.Configuration;


    // Implements application logic using the ClientsEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public partial class ClientsDomainService : LinqToEntitiesDomainService<ClientsEntities>
    {
        public IQueryable<CLItblAcl> GetCLItblAcls()
        {
            return this.ObjectContext.CLItblAcls;
        }

        public void InsertCLItblAcl(CLItblAcl cLItblAcl)
        {
            if ((cLItblAcl.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblAcl, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblAcls.AddObject(cLItblAcl);
            }
        }

        public void UpdateCLItblAcl(CLItblAcl currentCLItblAcl)
        {
            this.ObjectContext.CLItblAcls.AttachAsModified(currentCLItblAcl, this.ChangeSet.GetOriginal(currentCLItblAcl));
        }

        public void DeleteCLItblAcl(CLItblAcl cLItblAcl)
        {
            if ((cLItblAcl.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblAcl, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblAcls.Attach(cLItblAcl);
                this.ObjectContext.CLItblAcls.DeleteObject(cLItblAcl);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLItblCompanies' query.
        public IQueryable<CLItblCompany> GetCLItblCompanies()
        {
            return this.ObjectContext.CLItblCompanies;
        }

        public void InsertCLItblCompany(CLItblCompany cLItblCompany)
        {
            if ((cLItblCompany.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblCompany, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblCompanies.AddObject(cLItblCompany);
            }
        }

        public void UpdateCLItblCompany(CLItblCompany currentCLItblCompany)
        {
            this.ObjectContext.CLItblCompanies.AttachAsModified(currentCLItblCompany, this.ChangeSet.GetOriginal(currentCLItblCompany));
        }

        public void DeleteCLItblCompany(CLItblCompany cLItblCompany)
        {
            if ((cLItblCompany.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblCompany, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblCompanies.Attach(cLItblCompany);
                this.ObjectContext.CLItblCompanies.DeleteObject(cLItblCompany);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLItblCompanyOptions' query.
        public IQueryable<CLItblCompanyOption> GetCLItblCompanyOptions()
        {
            return this.ObjectContext.CLItblCompanyOptions;
        }

        public void InsertCLItblCompanyOption(CLItblCompanyOption cLItblCompanyOption)
        {
            if ((cLItblCompanyOption.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblCompanyOption, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblCompanyOptions.AddObject(cLItblCompanyOption);
            }
        }

        public void UpdateCLItblCompanyOption(CLItblCompanyOption currentCLItblCompanyOption)
        {
            this.ObjectContext.CLItblCompanyOptions.AttachAsModified(currentCLItblCompanyOption, this.ChangeSet.GetOriginal(currentCLItblCompanyOption));
        }

        public void DeleteCLItblCompanyOption(CLItblCompanyOption cLItblCompanyOption)
        {
            if ((cLItblCompanyOption.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblCompanyOption, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblCompanyOptions.Attach(cLItblCompanyOption);
                this.ObjectContext.CLItblCompanyOptions.DeleteObject(cLItblCompanyOption);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLItblFederationDetails' query.
        public IQueryable<CLItblFederationDetail> GetCLItblFederationDetails()
        {
            return this.ObjectContext.CLItblFederationDetails;
        }

        public void InsertCLItblFederationDetail(CLItblFederationDetail cLItblFederationDetail)
        {
            if ((cLItblFederationDetail.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblFederationDetail, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblFederationDetails.AddObject(cLItblFederationDetail);
            }
        }

        public void UpdateCLItblFederationDetail(CLItblFederationDetail currentCLItblFederationDetail)
        {
            this.ObjectContext.CLItblFederationDetails.AttachAsModified(currentCLItblFederationDetail, this.ChangeSet.GetOriginal(currentCLItblFederationDetail));
        }

        public void DeleteCLItblFederationDetail(CLItblFederationDetail cLItblFederationDetail)
        {
            if ((cLItblFederationDetail.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblFederationDetail, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblFederationDetails.Attach(cLItblFederationDetail);
                this.ObjectContext.CLItblFederationDetails.DeleteObject(cLItblFederationDetail);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLItblReferences' query.
        public IQueryable<CLItblReference> GetCLItblReferences()
        {
            return this.ObjectContext.CLItblReferences;
        }

        public void InsertCLItblReference(CLItblReference cLItblReference)
        {
            if ((cLItblReference.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblReference, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblReferences.AddObject(cLItblReference);
            }
        }

        public void UpdateCLItblReference(CLItblReference currentCLItblReference)
        {
            this.ObjectContext.CLItblReferences.AttachAsModified(currentCLItblReference, this.ChangeSet.GetOriginal(currentCLItblReference));
        }

        public void DeleteCLItblReference(CLItblReference cLItblReference)
        {
            if ((cLItblReference.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblReference, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblReferences.Attach(cLItblReference);
                this.ObjectContext.CLItblReferences.DeleteObject(cLItblReference);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLItblUsers' query.
        public IQueryable<CLItblUser> GetCLItblUsers()
        {
            return this.ObjectContext.CLItblUsers;
        }

        public void InsertCLItblUser(CLItblUser cLItblUser)
        {
            if ((cLItblUser.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblUser, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblUsers.AddObject(cLItblUser);
            }
        }

        public void UpdateCLItblUser(CLItblUser currentCLItblUser)
        {
            this.ObjectContext.CLItblUsers.AttachAsModified(currentCLItblUser, this.ChangeSet.GetOriginal(currentCLItblUser));
        }

        public void DeleteCLItblUser(CLItblUser cLItblUser)
        {
            if ((cLItblUser.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblUser, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblUsers.Attach(cLItblUser);
                this.ObjectContext.CLItblUsers.DeleteObject(cLItblUser);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLItblUserOptions' query.
        public IQueryable<CLItblUserOption> GetCLItblUserOptions()
        {
            return this.ObjectContext.CLItblUserOptions;
        }

        public void InsertCLItblUserOption(CLItblUserOption cLItblUserOption)
        {
            if ((cLItblUserOption.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblUserOption, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblUserOptions.AddObject(cLItblUserOption);
            }
        }

        public void UpdateCLItblUserOption(CLItblUserOption currentCLItblUserOption)
        {
            this.ObjectContext.CLItblUserOptions.AttachAsModified(currentCLItblUserOption, this.ChangeSet.GetOriginal(currentCLItblUserOption));
        }

        public void DeleteCLItblUserOption(CLItblUserOption cLItblUserOption)
        {
            if ((cLItblUserOption.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblUserOption, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblUserOptions.Attach(cLItblUserOption);
                this.ObjectContext.CLItblUserOptions.DeleteObject(cLItblUserOption);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLItblCompanyUsers' query.
        public IQueryable<CLItblCompanyUser> GetCLItblCompanyUsers()
        {
            return this.ObjectContext.CLItblCompanyUsers;
        }

        public void InsertCLItblCompanyUser(CLItblCompanyUser cLItblCompanyUser)
        {
            if ((cLItblCompanyUser.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblCompanyUser, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CLItblCompanyUsers.AddObject(cLItblCompanyUser);
            }
        }

        public void UpdateCLItblCompanyUser(CLItblCompanyUser currentCLItblCompanyUser)
        {
            this.ObjectContext.CLItblCompanyUsers.AttachAsModified(currentCLItblCompanyUser, this.ChangeSet.GetOriginal(currentCLItblCompanyUser));
        }

        public void DeleteCLItblCompanyUser(CLItblCompanyUser cLItblCompanyUser)
        {
            if ((cLItblCompanyUser.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(cLItblCompanyUser, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CLItblCompanyUsers.Attach(cLItblCompanyUser);
                this.ObjectContext.CLItblCompanyUsers.DeleteObject(cLItblCompanyUser);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CLIvwEmployeeTypes' query.
        public IQueryable<CLIvwEmployeeType> GetCLIvwEmployeeTypes()
        {
            return this.ObjectContext.CLIvwEmployeeTypes;
        }
    }
}


